class Adherent < ActiveRecord::Base
  validates_presence_of :nom, :prenom, :dateDeNaissance, :adresse, :cp, :ville
  validates_numericality_of :only_integer => true, :lenght => 5
  
   
  CIVILITE = [
    # Affichage        valeur dans la base
    [ "Monsieur"   ,    "Mr."],
    [ "Madame"    ,     "Mme."],
    [ "Mademoiselle",   "Melle."]
  ]
  validates_inclusion_of :civilite, :in => CIVILITE.map {|disp, value| value }
  has_and_belongs_to_many :activite, :join_table => "adherents_activites", :foreign_key => "activite_id"
end
